<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
    <title>每天60秒读懂世界</title>
    <meta name="keywords" content="输出每天60秒读懂世界新闻资讯" />
    <meta name="description" content="输出每天60秒读懂世界新闻资讯" />
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="/css/main.min.css" />
    <link rel="stylesheet" type="text/css" href="/css/ashes.min.css" />
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background: #f5f5f5;
            margin: 0;
        }
        .container {
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            text-align: center;
            max-width: 600px;
            width: 100%;
        }
        .container img {
            max-width: 100%;
            border-radius: 10px;
            margin-top: 10px;
        }
        .news {
            font-size: 16px;
            margin: 20px 0;
        }
        .news-item {
            margin-bottom: 10px;
        }
        button {
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
            border: none;
            border-radius: 5px;
            background-color: #007bff;
            color: white;
        }
        button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>热搜热榜聚集</h1>
    <img id="banner-img" src="" alt="每日图片" style="display: none;">
    <div class="news" id="news-list">
        <p>点击下方按钮获取热榜</p>
    </div>
    <button onclick="fetchNews()">获取热点</button>
</div>
<script>
    function fetchNews() {
        fetch('https://api.vvhan.com/api/hotlist/baiduRD')
            .then(response => response.json())
            .then(data => {
                if (data.success) {
                    const newsList = document.getElementById('news-list');
                    newsList.innerHTML = '';
                    let item = data.data;
                    for (let j = 0; j < data.data.length; j++) {
                        const newsItem = document.createElement('div');
                        newsItem.innerText = item[j].title +'\n' + item[j].hot+'\n'+item[j].url;
                        newsList.appendChild(newsItem);
                        console.log(newsItem.innerHTML)
                    }
                }
            })
            .catch(error => {
                console.error('Error fetching news:', error);
            });
    }
</script>
</body>
</html>
